package dk.au.cs.bdsi.core.resources;

import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;

import dk.au.cs.bdsi.core.representation.ServiceUri;

public class CoreResource {
	protected @Context UriInfo uriInfo;
	
	/**
	 * Retrieve a {@link ServiceUri} instance of the current
	 * (if any) active request URI. I.e. it may only be called
	 * in the context (scope) of an active request.
	 * 
	 * @return Request URI wrapped in a ServiceUri
	 */
	protected ServiceUri requestUri() {
		return new ServiceUri(uriInfo.getRequestUri());
	}
}
